home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.4 KB | 45 lines | [TEXT/ttxt] |
- --<<<
- -- Filename: SIMPLE.SX
-
- -- Purpose:
- -- Creates a simple title that displays the words "Hello, world" in a window
-
- -- Other Files Required: (none)
-
- -- Instructions to User:
- -- 1. Open this script in ScriptX. It will create a window, add text to it,
- -- create a title container file called SIMPLE.SXT, and add the window to
- -- the container.
- -- 2. Quit ScriptX. Open SIMPLE.SXT, the newly created title container,
- -- from the operating system. It should open up the window and display
- -- the text "Hello, world"
-
- -- Specialized Classes: (none)
-
- -- Author: Douglas Kramer
-
- ------------------------------------------------------------------------------
-
- -- Create a window and show it
- global myWindow := new Window boundary:(new Rect x2:400 y2:300)
- myWindow.y := 40
- show myWindow
-
- -- Create text and add it to the window
- global myText := new TextPresenter target:"Hello, world" \
- boundary:(new Rect x2:200 y2:50)
- append myWindow myText
-
- -- Create a title container. Notice the filename ends in .SXT
- -- indicating it contains a title container.
- global tc := new TitleContainer dir:theScriptDir path:"SIMPLE.SXT"
-
- -- Move the window to the title container (from the scratch title)
- prepend tc myWindow
-
- -- Include the startup script, which is an anonymous function
- tc.startupAction := (t -> load t[1])
-
- -- Close the title container
- close tc
-